<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>add_node</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab function</center>
    <div align="right">Last update : September 1996</div>
    <p>
      <b>add_node</b> -  adds a disconnected node to a graph</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>g1 = add_node(g,[xy,name])  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>g</b>
        </tt>: graph list</li>
      <li>
        <tt>
          <b>xy</b>
        </tt>: optional row vector of coordinates of new node</li>
      <li>
        <tt>
          <b>name</b>
        </tt>: optional name of the added node</li>
      <li>
        <tt>
          <b>g1</b>
        </tt>: graph list of the new graph with the added node</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
      <tt>
        <b>add_node</b>
      </tt> adds a disconnected node to graph <tt>
        <b>g</b>
      </tt> and returns the new
    graph <tt>
        <b>g1</b>
      </tt>.</p>
    <p>
    The coordinates of the new node can be given as a row vector of
    coordinates in <tt>
        <b>xy</b>
      </tt>. If the nodes of graph <tt>
        <b>g</b>
      </tt> have no
    coordinates (elements <tt>
        <b>node_x</b>
      </tt> and <tt>
        <b>node_y</b>
      </tt> are <tt>
        <b>[]</b>
      </tt>), to
    give <tt>
        <b>xy</b>
      </tt> has no effect. If the nodes of graph <tt>
        <b>g</b>
      </tt> have
    coordinates and <tt>
        <b>xy</b>
      </tt> is not given, the new node has <tt>
        <b>(0,0)</b>
      </tt> as
    coordinates.</p>
    <p>
    If <tt>
        <b>name</b>
      </tt> is given, it is the name of the new node, otherwise the number
    of nodes plus 1 is taken as the name of the new node.</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

ta=[1 1 2 2 2 3 4 5 5 7 8 8 9 10 10 10 11 12 13 13 13 14 15 16 16 17 17];
he=[2 10 3 5 7 4 2 4 6 8 6 9 7 7 11 15 12 13 9 10 14 11 16 1 17 14 15];
g=make_graph('foo',1,17,ta,he);
g('node_x')=[283 163 63 57 164 164 273 271 339 384 504 513 439 623 631 757 642];
g('node_y')=[59 133 223 318 227 319 221 324 432 141 209 319 428 443 187 151 301];
show_graph(g);
n=g('node_number');
g1=add_node(g,[270 140]);
g1('node_color')=[ones(1,n) 11];
show_graph(g1);
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="add_edge.htm">
        <tt>
          <b>add_edge</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="delete_arcs.htm">
        <tt>
          <b>delete_arcs</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="delete_nodes.htm">
        <tt>
          <b>delete_nodes</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
